package com.ruoyi.web.controller.workflow;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.workflow.domain.CarPackageAudit;

import com.ruoyi.workflow.service.ICarPackageAuditService;
import com.ruoyi.workflow.service.ITaskToDoService;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;

/**
 * 代办任务Controller
 *
 * @author csj
 * @date 2022-11-18
 */
@RestController
@RequestMapping("/workflow/todo")
public class TaskTodoController extends BaseController {
    @Autowired
    private ITaskToDoService taskToDoService;

    /**
     * 查询代办任务列表
     */
    @GetMapping("/list")
    public TableDataInfo list(CarPackageAudit carPackageAudit) {

        return taskToDoService.selectTodoList(carPackageAudit);
    }

    @GetMapping("/reapply")
    public AjaxResult reapply(Long id, String taskId) {
        taskToDoService.reapply(id, taskId);
        return AjaxResult.success("success");
    }


}
